export const schema = {
    type: "page",
    title: "查看商品",
    initApi: "/api/goods/${id}",
    body: [
        {
            type: "nav",
            stacked: false,
            links: [
                {
                    label: "查看",
                    to: "/score_mall/goods/view/${id}"
                },
                {
                    label: "编辑",
                    to: "/score_mall/goods/edit/${id}"
                },
            ]
        },
        {
            type: "wrapper",
            className: "b-l b-b b-r bg-white no-padder",
            body: {
                api: "put:/api/goods/${id}",
                submitText: "",
                name: "createform",
                type: "form",
                title: "",
                className: "m-t-md",
                panelClassName: "no-border no-shadow m-b-none",
                mode: "horizontal",
                // actions: [
                //     {
                //         type: "button",
                //         actionType: "submit",
                //         label: "提交",
                //         icon: "fa fa-check pull-left",
                //         level: "primary",
                //         redirect: "/score_mall/goods/edit/${id}",
                //     },
                // ],
                fieldSet: [
                    {
                        title: "基本信息",
                        controls: [
                            {
                                type: "static",
                                name: "org_info",
                                label: "所属机构",
                                tpl: "${org_info.name}"
                            },

                            {
                                type: "static",
                                name: "team_info",
                                label: "发布团队",
                                tpl: "${team_info.name}"
                            },


                            {
                                label: "商品名称",
                                name: "g_name",
                                type: "static",
                            },

                            {
                                label: "支持方",
                                name: "sponsor",
                                type: "static",
                            },
                            {
                                type: "static-image",
                                label: "海报",
                                name: "thumbnail"
                            },
                            {
                                type: "static-image",
                                label: "商品大图",
                                name: "g_img"
                            },

                            {
                                label: "商品详情",
                                name: "content",
                                type: "rich-text",
                                disabled: true

                            },

                            {
                                label: "兑换成功文案",
                                name: "access",
                                type: "static",
                            },
                        ]
                    },

                    {
                        title: "兑换规则",
                        controls: [
                            {
                                type: "static",
                                label: "市面价值",
                                name: "price",
                            },
                            {
                                name: 'points',
                                label: '消耗积分',
                                type: 'static'
                            },
                            {
                                name: 'g_num',
                                label: '库存',
                                type: 'static',
                                tpl: '<% if (data.g_num && data.g_num != 0) { %> <%= data.g_num %><% } else { %> 无限制 <% } %>'
                            },
                            {
                                name: 'u_num',
                                label: '用户兑换限制',
                                type: 'static',
                                tpl: '<% if (data.u_num && data.u_num != 0) { %> <%= data.u_num %><% } else { %> 无限制 <% } %>'
                            },

                            [
                                {
                                    label: "线下兑换日期",
                                    type: "date",
                                    name: "start_time",
                                    disabled: true
                                },

                                {
                                    label: "到",
                                    labelClassName: "w-xxs",
                                    type: "date",
                                    name: "end_time",
                                    disabled: true
                                }
                            ],
                            {
                                label: "自动下架时间",
                                type: "date",
                                name: "auto_time",
                                width: 200,
                                disabled: true
                            },
                            {
                                type: "static",
                                label: "额外兑换限制",
                                name: "condition",
                            },
                            // {
                            //     label: '领取方式',
                            //     name: '',
                            //     type: "radios",
                            //     inline: true,
                            //     options: [
                            //         {
                            //             label: "快递",
                            //             value: 1
                            //         },
                            //         {
                            //             label: "类型2",
                            //             value: 2
                            //         }
                            //     ],
                            // },

                            {
                                type: "checkbox",
                                name: "examine",
                                option: "是否开启审核？",
                                disabled: true
                            },

                        ]
                    },
                ]
            }
        }]
};
